home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gcc / gcc258s.zoo / gcc.info-21 < prev    next >
Encoding:
GNU Info File  |  1993-11-30  |  36.1 KB  |  841 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.  
  4.    This file documents the use and the internals of the GNU compiler.
  5.  
  6.    Published by the Free Software Foundation 675 Massachusetts Avenue
  7. Cambridge, MA 02139 USA
  8.  
  9.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11.    Permission is granted to make and distribute verbatim copies of this
  12. manual provided the copyright notice and this permission notice are
  13. preserved on all copies.
  14.  
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Protect
  18. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  19. original, and provided that the entire resulting derived work is
  20. distributed under the terms of a permission notice identical to this
  21. one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that the sections entitled "GNU General Public
  26. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  27. permission notice, may be included in translations approved by the Free
  28. Software Foundation instead of in the original English.
  29.  
  30. File: gcc.info,  Node: Macros for Initialization,  Next: Instruction Output,  Prev: Initialization,  Up: Assembler Format
  31.  
  32. Macros Controlling Initialization Routines
  33. ------------------------------------------
  34.  
  35.    Here are the macros that control how the compiler handles
  36. initialization and termination functions:
  37.  
  38. `INIT_SECTION_ASM_OP'
  39.      If defined, a C string constant for the assembler operation to
  40.      identify the following data as initialization code.  If not
  41.      defined, GNU CC will assume such a section does not exist.  When
  42.      you are using special sections for initialization and termination
  43.      functions, this macro also controls how `crtstuff.c' and
  44.      `libgcc2.c' arrange to run the initialization functions.
  45.  
  46. `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
  47.      Define this macro as a C statement to output on the stream STREAM
  48.      the assembler code to arrange to call the function named NAME at
  49.      initialization time.
  50.  
  51.      Assume that NAME is the name of a C function generated
  52.      automatically by the compiler.  This function takes no arguments.
  53.      Use the function `assemble_name' to output the name NAME; this
  54.      performs any system-specific syntactic transformations such as
  55.      adding an underscore.
  56.  
  57.      If you don't define this macro, nothing special is output to
  58.      arrange to call the function.  This is correct when the function
  59.      will be called in some other manner--for example, by means of the
  60.      `collect2' program, which looks through the symbol table to find
  61.      these functions by their names.
  62.  
  63. `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
  64.      This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
  65.      functions rather than initialization functions.
  66.  
  67.    If your system uses `collect2' as the means of processing
  68. constructors, then that program normally uses `nm' to scan an object
  69. file for constructor functions to be called.  On certain kinds of
  70. systems, you can define these macros to make `collect2' work faster
  71. (and, in some cases, make it work at all):
  72.  
  73. `OBJECT_FORMAT_COFF'
  74.      Define this macro if the system uses COFF (Common Object File
  75.      Format) object files, so that `collect2' can assume this format
  76.      and scan object files directly for dynamic constructor/destructor
  77.      functions.
  78.  
  79. `OBJECT_FORMAT_ROSE'
  80.      Define this macro if the system uses ROSE format object files, so
  81.      that `collect2' can assume this format and scan object files
  82.      directly for dynamic constructor/destructor functions.
  83.  
  84.    These macros are effective only in a native compiler; `collect2' as
  85. part of a cross compiler always uses `nm'.
  86.  
  87. `REAL_NM_FILE_NAME'
  88.      Define this macro as a C string constant containing the file name
  89.      to use to execute `nm'.  The default is to search the path
  90.      normally for `nm'.
  91.  
  92. File: gcc.info,  Node: Instruction Output,  Next: Dispatch Tables,  Prev: Macros for Initialization,  Up: Assembler Format
  93.  
  94. Output of Assembler Instructions
  95. --------------------------------
  96.  
  97. `REGISTER_NAMES'
  98.      A C initializer containing the assembler's names for the machine
  99.      registers, each one as a C string constant.  This is what
  100.      translates register numbers in the compiler into assembler
  101.      language.
  102.  
  103. `ADDITIONAL_REGISTER_NAMES'
  104.      If defined, a C initializer for an array of structures containing
  105.      a name and a register number.  This macro defines additional names
  106.      for hard registers, thus allowing the `asm' option in declarations
  107.      to refer to registers using alternate names.
  108.  
  109. `ASM_OUTPUT_OPCODE (STREAM, PTR)'
  110.      Define this macro if you are using an unusual assembler that
  111.      requires different names for the machine instructions.
  112.  
  113.      The definition is a C statement or statements which output an
  114.      assembler instruction opcode to the stdio stream STREAM.  The
  115.      macro-operand PTR is a variable of type `char *' which points to
  116.      the opcode name in its "internal" form--the form that is written
  117.      in the machine description.  The definition should output the
  118.      opcode name to STREAM, performing any translation you desire, and
  119.      increment the variable PTR to point at the end of the opcode so
  120.      that it will not be output twice.
  121.  
  122.      In fact, your macro definition may process less than the entire
  123.      opcode name, or more than the opcode name; but if you want to
  124.      process text that includes `%'-sequences to substitute operands,
  125.      you must take care of the substitution yourself.  Just be sure to
  126.      increment PTR over whatever text should not be output normally.
  127.  
  128.      If you need to look at the operand values, they can be found as the
  129.      elements of `recog_operand'.
  130.  
  131.      If the macro definition does nothing, the instruction is output in
  132.      the usual way.
  133.  
  134. `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
  135.      If defined, a C statement to be executed just prior to the output
  136.      of assembler code for INSN, to modify the extracted operands so
  137.      they will be output differently.
  138.  
  139.      Here the argument OPVEC is the vector containing the operands
  140.      extracted from INSN, and NOPERANDS is the number of elements of
  141.      the vector which contain meaningful data for this insn.  The
  142.      contents of this vector are what will be used to convert the insn
  143.      template into assembler code, so you can change the assembler
  144.      output by changing the contents of the vector.
  145.  
  146.      This macro is useful when various assembler syntaxes share a single
  147.      file of instruction patterns; by defining this macro differently,
  148.      you can cause a large class of instructions to be output
  149.      differently (such as with rearranged operands).  Naturally,
  150.      variations in assembler syntax affecting individual insn patterns
  151.      ought to be handled by writing conditional output routines in
  152.      those patterns.
  153.  
  154.      If this macro is not defined, it is equivalent to a null statement.
  155.  
  156. `PRINT_OPERAND (STREAM, X, CODE)'
  157.      A C compound statement to output to stdio stream STREAM the
  158.      assembler syntax for an instruction operand X.  X is an RTL
  159.      expression.
  160.  
  161.      CODE is a value that can be used to specify one of several ways of
  162.      printing the operand.  It is used when identical operands must be
  163.      printed differently depending on the context.  CODE comes from the
  164.      `%' specification that was used to request printing of the
  165.      operand.  If the specification was just `%DIGIT' then CODE is 0;
  166.      if the specification was `%LTR DIGIT' then CODE is the ASCII code
  167.      for LTR.
  168.  
  169.      If X is a register, this macro should print the register's name.
  170.      The names can be found in an array `reg_names' whose type is `char
  171.      *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
  172.  
  173.      When the machine description has a specification `%PUNCT' (a `%'
  174.      followed by a punctuation character), this macro is called with a
  175.      null pointer for X and the punctuation character for CODE.
  176.  
  177. `PRINT_OPERAND_PUNCT_VALID_P (CODE)'
  178.      A C expression which evaluates to true if CODE is a valid
  179.      punctuation character for use in the `PRINT_OPERAND' macro.  If
  180.      `PRINT_OPERAND_PUNCT_VALID_P' is not defined, it means that no
  181.      punctuation characters (except for the standard one, `%') are used
  182.      in this way.
  183.  
  184. `PRINT_OPERAND_ADDRESS (STREAM, X)'
  185.      A C compound statement to output to stdio stream STREAM the
  186.      assembler syntax for an instruction operand that is a memory
  187.      reference whose address is X.  X is an RTL expression.
  188.  
  189.      On some machines, the syntax for a symbolic address depends on the
  190.      section that the address refers to.  On these machines, define the
  191.      macro `ENCODE_SECTION_INFO' to store the information into the
  192.      `symbol_ref', and then check for it here.  *Note Assembler
  193.      Format::.
  194.  
  195. `DBR_OUTPUT_SEQEND(FILE)'
  196.      A C statement, to be executed after all slot-filler instructions
  197.      have been output.  If necessary, call `dbr_sequence_length' to
  198.      determine the number of slots filled in a sequence (zero if not
  199.      currently outputting a sequence), to decide how many no-ops to
  200.      output, or whatever.
  201.  
  202.      Don't define this macro if it has nothing to do, but it is helpful
  203.      in reading assembly output if the extent of the delay sequence is
  204.      made explicit (e.g. with white space).
  205.  
  206.      Note that output routines for instructions with delay slots must be
  207.      prepared to deal with not being output as part of a sequence (i.e.
  208.      when the scheduling pass is not run, or when no slot fillers could
  209.      be found.)  The variable `final_sequence' is null when not
  210.      processing a sequence, otherwise it contains the `sequence' rtx
  211.      being output.
  212.  
  213. `REGISTER_PREFIX'
  214. `LOCAL_LABEL_PREFIX'
  215. `USER_LABEL_PREFIX'
  216. `IMMEDIATE_PREFIX'
  217.      If defined, C string expressions to be used for the `%R', `%L',
  218.      `%U', and `%I' options of `asm_fprintf' (see `final.c').  These
  219.      are useful when a single `md' file must support multiple assembler
  220.      formats.  In that case, the various `tm.h' files can define these
  221.      macros differently.
  222.  
  223. `ASSEMBLER_DIALECT'
  224.      If your target supports multiple dialects of assembler language
  225.      (such as different opcodes), define this macro as a C expression
  226.      that gives the numeric index of the assembler langauge dialect to
  227.      use, with zero as the first variant.
  228.  
  229.      If this macro is defined, you may use
  230.      `{option0|option1|option2...}' constructs in the output templates
  231.      of patterns (*note Output Template::.) or in the first argument of
  232.      `asm_fprintf'.  This construct outputs `option0', `option1' or
  233.      `option2', etc., if the value of `ASSEMBLER_DIALECT' is zero, one
  234.      or two, etc.  Any special characters within these strings retain
  235.      their usual meaning.
  236.  
  237.      If you do not define this macro, the characters `{', `|' and `}'
  238.      do not have any special meaning when used in templates or operands
  239.      to `asm_fprintf'.
  240.  
  241.      Define the macros `REGISTER_PREFIX', `LOCAL_LABEL_PREFIX',
  242.      `USER_LABEL_PREFIX' and `IMMEDIATE_PREFIX' if you can express the
  243.      variations in assemble language syntax with that mechanism.  Define
  244.      `ASSEMBLER_DIALECT' and use the `{option0|option1}' syntax if the
  245.      syntax variant are larger and involve such things as different
  246.      opcodes or operand order.
  247.  
  248. `ASM_OUTPUT_REG_PUSH (STREAM, REGNO)'
  249.      A C expression to output to STREAM some assembler code which will
  250.      push hard register number REGNO onto the stack.  The code need not
  251.      be optimal, since this macro is used only when profiling.
  252.  
  253. `ASM_OUTPUT_REG_POP (STREAM, REGNO)'
  254.      A C expression to output to STREAM some assembler code which will
  255.      pop hard register number REGNO off of the stack.  The code need
  256.      not be optimal, since this macro is used only when profiling.
  257.  
  258. File: gcc.info,  Node: Dispatch Tables,  Next: Alignment Output,  Prev: Instruction Output,  Up: Assembler Format
  259.  
  260. Output of Dispatch Tables
  261. -------------------------
  262.  
  263. `ASM_OUTPUT_ADDR_DIFF_ELT (STREAM, VALUE, REL)'
  264.      This macro should be provided on machines where the addresses in a
  265.      dispatch table are relative to the table's own address.
  266.  
  267.      The definition should be a C statement to output to the stdio
  268.      stream STREAM an assembler pseudo-instruction to generate a
  269.      difference between two labels.  VALUE and REL are the numbers of
  270.      two internal labels.  The definitions of these labels are output
  271.      using `ASM_OUTPUT_INTERNAL_LABEL', and they must be printed in the
  272.      same way here.  For example,
  273.  
  274.           fprintf (STREAM, "\t.word L%d-L%d\n",
  275.                    VALUE, REL)
  276.  
  277. `ASM_OUTPUT_ADDR_VEC_ELT (STREAM, VALUE)'
  278.      This macro should be provided on machines where the addresses in a
  279.      dispatch table are absolute.
  280.  
  281.      The definition should be a C statement to output to the stdio
  282.      stream STREAM an assembler pseudo-instruction to generate a
  283.      reference to a label.  VALUE is the number of an internal label
  284.      whose definition is output using `ASM_OUTPUT_INTERNAL_LABEL'.  For
  285.      example,
  286.  
  287.           fprintf (STREAM, "\t.word L%d\n", VALUE)
  288.  
  289. `ASM_OUTPUT_CASE_LABEL (STREAM, PREFIX, NUM, TABLE)'
  290.      Define this if the label before a jump-table needs to be output
  291.      specially.  The first three arguments are the same as for
  292.      `ASM_OUTPUT_INTERNAL_LABEL'; the fourth argument is the jump-table
  293.      which follows (a `jump_insn' containing an `addr_vec' or
  294.      `addr_diff_vec').
  295.  
  296.      This feature is used on system V to output a `swbeg' statement for
  297.      the table.
  298.  
  299.      If this macro is not defined, these labels are output with
  300.      `ASM_OUTPUT_INTERNAL_LABEL'.
  301.  
  302. `ASM_OUTPUT_CASE_END (STREAM, NUM, TABLE)'
  303.      Define this if something special must be output at the end of a
  304.      jump-table.  The definition should be a C statement to be executed
  305.      after the assembler code for the table is written.  It should write
  306.      the appropriate code to stdio stream STREAM.  The argument TABLE
  307.      is the jump-table insn, and NUM is the label-number of the
  308.      preceding label.
  309.  
  310.      If this macro is not defined, nothing special is output at the end
  311.      of the jump-table.
  312.  
  313. File: gcc.info,  Node: Alignment Output,  Prev: Dispatch Tables,  Up: Assembler Format
  314.  
  315. Assembler Commands for Alignment
  316. --------------------------------
  317.  
  318. `ASM_OUTPUT_ALIGN_CODE (FILE)'
  319.      A C expression to output text to align the location counter in the
  320.      way that is desirable at a point in the code that is reached only
  321.      by jumping.
  322.  
  323.      This macro need not be defined if you don't want any special
  324.      alignment to be done at such a time.  Most machine descriptions do
  325.      not currently define the macro.
  326.  
  327. `ASM_OUTPUT_LOOP_ALIGN (FILE)'
  328.      A C expression to output text to align the location counter in the
  329.      way that is desirable at the beginning of a loop.
  330.  
  331.      This macro need not be defined if you don't want any special
  332.      alignment to be done at such a time.  Most machine descriptions do
  333.      not currently define the macro.
  334.  
  335. `ASM_OUTPUT_SKIP (STREAM, NBYTES)'
  336.      A C statement to output to the stdio stream STREAM an assembler
  337.      instruction to advance the location counter by NBYTES bytes.
  338.      Those bytes should be zero when loaded.  NBYTES will be a C
  339.      expression of type `int'.
  340.  
  341. `ASM_NO_SKIP_IN_TEXT'
  342.      Define this macro if `ASM_OUTPUT_SKIP' should not be used in the
  343.      text section because it fails put zeros in the bytes that are
  344.      skipped.  This is true on many Unix systems, where the pseudo-op
  345.      to skip bytes produces no-op instructions rather than zeros when
  346.      used in the text section.
  347.  
  348. `ASM_OUTPUT_ALIGN (STREAM, POWER)'
  349.      A C statement to output to the stdio stream STREAM an assembler
  350.      command to advance the location counter to a multiple of 2 to the
  351.      POWER bytes.  POWER will be a C expression of type `int'.
  352.  
  353. File: gcc.info,  Node: Debugging Info,  Next: Cross-compilation,  Prev: Assembler Format,  Up: Target Macros
  354.  
  355. Controlling Debugging Information Format
  356. ========================================
  357.  
  358. * Menu:
  359.  
  360. * All Debuggers::      Macros that affect all debugging formats uniformly.
  361. * DBX Options::        Macros enabling specific options in DBX format.
  362. * DBX Hooks::          Hook macros for varying DBX format.
  363. * File Names and DBX:: Macros controlling output of file names in DBX format.
  364. * SDB and DWARF::      Macros for SDB (COFF) and DWARF formats.
  365.  
  366. File: gcc.info,  Node: All Debuggers,  Next: DBX Options,  Up: Debugging Info
  367.  
  368. Macros Affecting All Debugging Formats
  369. --------------------------------------
  370.  
  371. `DBX_REGISTER_NUMBER (REGNO)'
  372.      A C expression that returns the DBX register number for the
  373.      compiler register number REGNO.  In simple cases, the value of this
  374.      expression may be REGNO itself.  But sometimes there are some
  375.      registers that the compiler knows about and DBX does not, or vice
  376.      versa.  In such cases, some register may need to have one number in
  377.      the compiler and another for DBX.
  378.  
  379.      If two registers have consecutive numbers inside GNU CC, and they
  380.      can be used as a pair to hold a multiword value, then they *must*
  381.      have consecutive numbers after renumbering with
  382.      `DBX_REGISTER_NUMBER'.  Otherwise, debuggers will be unable to
  383.      access such a pair, because they expect register pairs to be
  384.      consecutive in their own numbering scheme.
  385.  
  386.      If you find yourself defining `DBX_REGISTER_NUMBER' in way that
  387.      does not preserve register pairs, then what you must do instead is
  388.      redefine the actual register numbering scheme.
  389.  
  390. `DEBUGGER_AUTO_OFFSET (X)'
  391.      A C expression that returns the integer offset value for an
  392.      automatic variable having address X (an RTL expression).  The
  393.      default computation assumes that X is based on the frame-pointer
  394.      and gives the offset from the frame-pointer.  This is required for
  395.      targets that produce debugging output for DBX or COFF-style
  396.      debugging output for SDB and allow the frame-pointer to be
  397.      eliminated when the `-g' options is used.
  398.  
  399. `DEBUGGER_ARG_OFFSET (OFFSET, X)'
  400.      A C expression that returns the integer offset value for an
  401.      argument having address X (an RTL expression).  The nominal offset
  402.      is OFFSET.
  403.  
  404. `PREFERRED_DEBUGGING_TYPE'
  405.      A C expression that returns the type of debugging output GNU CC
  406.      produces when the user specifies `-g' or `-ggdb'.  Define this if
  407.      you have arranged for GNU CC to support more than one format of
  408.      debugging output.  Currently, the allowable values are `DBX_DEBUG',
  409.      `SDB_DEBUG', `DWARF_DEBUG', and `XCOFF_DEBUG'.
  410.  
  411.      The value of this macro only affects the default debugging output;
  412.      the user can always get a specific type of output by using
  413.      `-gstabs', `-gcoff', `-gdwarf', or `-gxcoff'.
  414.  
  415. File: gcc.info,  Node: DBX Options,  Next: DBX Hooks,  Prev: All Debuggers,  Up: Debugging Info
  416.  
  417. Specific Options for DBX Output
  418. -------------------------------
  419.  
  420. `DBX_DEBUGGING_INFO'
  421.      Define this macro if GNU CC should produce debugging output for DBX
  422.      in response to the `-g' option.
  423.  
  424. `XCOFF_DEBUGGING_INFO'
  425.      Define this macro if GNU CC should produce XCOFF format debugging
  426.      output in response to the `-g' option.  This is a variant of DBX
  427.      format.
  428.  
  429. `DEFAULT_GDB_EXTENSIONS'
  430.      Define this macro to control whether GNU CC should by default
  431.      generate GDB's extended version of DBX debugging information
  432.      (assuming DBX-format debugging information is enabled at all).  If
  433.      you don't define the macro, the default is 1: always generate the
  434.      extended information if there is any occasion to.
  435.  
  436. `DEBUG_SYMS_TEXT'
  437.      Define this macro if all `.stabs' commands should be output while
  438.      in the text section.
  439.  
  440. `ASM_STABS_OP'
  441.      A C string constant naming the assembler pseudo op to use instead
  442.      of `.stabs' to define an ordinary debugging symbol.  If you don't
  443.      define this macro, `.stabs' is used.  This macro applies only to
  444.      DBX debugging information format.
  445.  
  446. `ASM_STABD_OP'
  447.      A C string constant naming the assembler pseudo op to use instead
  448.      of `.stabd' to define a debugging symbol whose value is the current
  449.      location.  If you don't define this macro, `.stabd' is used.  This
  450.      macro applies only to DBX debugging information format.
  451.  
  452. `ASM_STABN_OP'
  453.      A C string constant naming the assembler pseudo op to use instead
  454.      of `.stabn' to define a debugging symbol with no name.  If you
  455.      don't define this macro, `.stabn' is used.  This macro applies
  456.      only to DBX debugging information format.
  457.  
  458. `DBX_NO_XREFS'
  459.      Define this macro if DBX on your system does not support the
  460.      construct `xsTAGNAME'.  On some systems, this construct is used to
  461.      describe a forward reference to a structure named TAGNAME.  On
  462.      other systems, this construct is not supported at all.
  463.  
  464. `DBX_CONTIN_LENGTH'
  465.      A symbol name in DBX-format debugging information is normally
  466.      continued (split into two separate `.stabs' directives) when it
  467.      exceeds a certain length (by default, 80 characters).  On some
  468.      operating systems, DBX requires this splitting; on others,
  469.      splitting must not be done.  You can inhibit splitting by defining
  470.      this macro with the value zero.  You can override the default
  471.      splitting-length by defining this macro as an expression for the
  472.      length you desire.
  473.  
  474. `DBX_CONTIN_CHAR'
  475.      Normally continuation is indicated by adding a `\' character to
  476.      the end of a `.stabs' string when a continuation follows.  To use
  477.      a different character instead, define this macro as a character
  478.      constant for the character you want to use.  Do not define this
  479.      macro if backslash is correct for your system.
  480.  
  481. `DBX_STATIC_STAB_DATA_SECTION'
  482.      Define this macro if it is necessary to go to the data section
  483.      before outputting the `.stabs' pseudo-op for a non-global static
  484.      variable.
  485.  
  486. `DBX_TYPE_DECL_STABS_CODE'
  487.      The value to use in the "code" field of the `.stabs' directive for
  488.      a typedef.  The default is `N_LSYM'.
  489.  
  490. `DBX_STATIC_CONST_VAR_CODE'
  491.      The value to use in the "code" field of the `.stabs' directive for
  492.      a static variable located in the text section.  DBX format does not
  493.      provide any "right" way to do this.  The default is `N_FUN'.
  494.  
  495. `DBX_REGPARM_STABS_CODE'
  496.      The value to use in the "code" field of the `.stabs' directive for
  497.      a parameter passed in registers.  DBX format does not provide any
  498.      "right" way to do this.  The default is `N_RSYM'.
  499.  
  500. `DBX_REGPARM_STABS_LETTER'
  501.      The letter to use in DBX symbol data to identify a symbol as a
  502.      parameter passed in registers.  DBX format does not customarily
  503.      provide any way to do this.  The default is `'P''.
  504.  
  505. `DBX_MEMPARM_STABS_LETTER'
  506.      The letter to use in DBX symbol data to identify a symbol as a
  507.      stack parameter.  The default is `'p''.
  508.  
  509. `DBX_FUNCTION_FIRST'
  510.      Define this macro if the DBX information for a function and its
  511.      arguments should precede the assembler code for the function.
  512.      Normally, in DBX format, the debugging information entirely
  513.      follows the assembler code.
  514.  
  515. `DBX_LBRAC_FIRST'
  516.      Define this macro if the `N_LBRAC' symbol for a block should
  517.      precede the debugging information for variables and functions
  518.      defined in that block.  Normally, in DBX format, the `N_LBRAC'
  519.      symbol comes first.
  520.  
  521. File: gcc.info,  Node: DBX Hooks,  Next: File Names and DBX,  Prev: DBX Options,  Up: Debugging Info
  522.  
  523. Open-Ended Hooks for DBX Format
  524. -------------------------------
  525.  
  526. `DBX_OUTPUT_LBRAC (STREAM, NAME)'
  527.      Define this macro to say how to output to STREAM the debugging
  528.      information for the start of a scope level for variable names.  The
  529.      argument NAME is the name of an assembler symbol (for use with
  530.      `assemble_name') whose value is the address where the scope begins.
  531.  
  532. `DBX_OUTPUT_RBRAC (STREAM, NAME)'
  533.      Like `DBX_OUTPUT_LBRAC', but for the end of a scope level.
  534.  
  535. `DBX_OUTPUT_ENUM (STREAM, TYPE)'
  536.      Define this macro if the target machine requires special handling
  537.      to output an enumeration type.  The definition should be a C
  538.      statement (sans semicolon) to output the appropriate information
  539.      to STREAM for the type TYPE.
  540.  
  541. `DBX_OUTPUT_FUNCTION_END (STREAM, FUNCTION)'
  542.      Define this macro if the target machine requires special output at
  543.      the end of the debugging information for a function.  The
  544.      definition should be a C statement (sans semicolon) to output the
  545.      appropriate information to STREAM.  FUNCTION is the
  546.      `FUNCTION_DECL' node for the function.
  547.  
  548. `DBX_OUTPUT_STANDARD_TYPES (SYMS)'
  549.      Define this macro if you need to control the order of output of the
  550.      standard data types at the beginning of compilation.  The argument
  551.      SYMS is a `tree' which is a chain of all the predefined global
  552.      symbols, including names of data types.
  553.  
  554.      Normally, DBX output starts with definitions of the types for
  555.      integers and characters, followed by all the other predefined
  556.      types of the particular language in no particular order.
  557.  
  558.      On some machines, it is necessary to output different particular
  559.      types first.  To do this, define `DBX_OUTPUT_STANDARD_TYPES' to
  560.      output those symbols in the necessary order.  Any predefined types
  561.      that you don't explicitly output will be output afterward in no
  562.      particular order.
  563.  
  564.      Be careful not to define this macro so that it works only for C.
  565.      There are no global variables to access most of the built-in
  566.      types, because another language may have another set of types.
  567.      The way to output a particular type is to look through SYMS to see
  568.      if you can find it.  Here is an example:
  569.  
  570.           {
  571.             tree decl;
  572.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  573.               if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
  574.                            "long int"))
  575.                 dbxout_symbol (decl);
  576.             ...
  577.           }
  578.  
  579.      This does nothing if the expected type does not exist.
  580.  
  581.      See the function `init_decl_processing' in `c-decl.c' to find the
  582.      names to use for all the built-in C types.
  583.  
  584.      Here is another way of finding a particular type:
  585.  
  586.           {
  587.             tree decl;
  588.             for (decl = syms; decl; decl = TREE_CHAIN (decl))
  589.               if (TREE_CODE (decl) == TYPE_DECL
  590.                   && (TREE_CODE (TREE_TYPE (decl))
  591.                       == INTEGER_CST)
  592.                   && TYPE_PRECISION (TREE_TYPE (decl)) == 16
  593.                   && TYPE_UNSIGNED (TREE_TYPE (decl)))
  594.           /* This must be `unsigned short'.  */
  595.                 dbxout_symbol (decl);
  596.             ...
  597.           }
  598.  
  599. File: gcc.info,  Node: File Names and DBX,  Next: SDB and DWARF,  Prev: DBX Hooks,  Up: Debugging Info
  600.  
  601. File Names in DBX Format
  602. ------------------------
  603.  
  604. `DBX_WORKING_DIRECTORY'
  605.      Define this if DBX wants to have the current directory recorded in
  606.      each object file.
  607.  
  608.      Note that the working directory is always recorded if GDB
  609.      extensions are enabled.
  610.  
  611. `DBX_OUTPUT_MAIN_SOURCE_FILENAME (STREAM, NAME)'
  612.      A C statement to output DBX debugging information to the stdio
  613.      stream STREAM which indicates that file NAME is the main source
  614.      file--the file specified as the input file for compilation.  This
  615.      macro is called only once, at the beginning of compilation.
  616.  
  617.      This macro need not be defined if the standard form of output for
  618.      DBX debugging information is appropriate.
  619.  
  620. `DBX_OUTPUT_MAIN_SOURCE_DIRECTORY (STREAM, NAME)'
  621.      A C statement to output DBX debugging information to the stdio
  622.      stream STREAM which indicates that the current directory during
  623.      compilation is named NAME.
  624.  
  625.      This macro need not be defined if the standard form of output for
  626.      DBX debugging information is appropriate.
  627.  
  628. `DBX_OUTPUT_MAIN_SOURCE_FILE_END (STREAM, NAME)'
  629.      A C statement to output DBX debugging information at the end of
  630.      compilation of the main source file NAME.
  631.  
  632.      If you don't define this macro, nothing special is output at the
  633.      end of compilation, which is correct for most machines.
  634.  
  635. `DBX_OUTPUT_SOURCE_FILENAME (STREAM, NAME)'
  636.      A C statement to output DBX debugging information to the stdio
  637.      stream STREAM which indicates that file NAME is the current source
  638.      file.  This output is generated each time input shifts to a
  639.      different source file as a result of `#include', the end of an
  640.      included file, or a `#line' command.
  641.  
  642.      This macro need not be defined if the standard form of output for
  643.      DBX debugging information is appropriate.
  644.  
  645. File: gcc.info,  Node: SDB and DWARF,  Prev: File Names and DBX,  Up: Debugging Info
  646.  
  647. Macros for SDB and DWARF Output
  648. -------------------------------
  649.  
  650. `SDB_DEBUGGING_INFO'
  651.      Define this macro if GNU CC should produce COFF-style debugging
  652.      output for SDB in response to the `-g' option.
  653.  
  654. `DWARF_DEBUGGING_INFO'
  655.      Define this macro if GNU CC should produce dwarf format debugging
  656.      output in response to the `-g' option.
  657.  
  658. `PUT_SDB_...'
  659.      Define these macros to override the assembler syntax for the
  660.      special SDB assembler directives.  See `sdbout.c' for a list of
  661.      these macros and their arguments.  If the standard syntax is used,
  662.      you need not define them yourself.
  663.  
  664. `SDB_DELIM'
  665.      Some assemblers do not support a semicolon as a delimiter, even
  666.      between SDB assembler directives.  In that case, define this macro
  667.      to be the delimiter to use (usually `\n').  It is not necessary to
  668.      define a new set of `PUT_SDB_OP' macros if this is the only change
  669.      required.
  670.  
  671. `SDB_GENERATE_FAKE'
  672.      Define this macro to override the usual method of constructing a
  673.      dummy name for anonymous structure and union types.  See
  674.      `sdbout.c' for more information.
  675.  
  676. `SDB_ALLOW_UNKNOWN_REFERENCES'
  677.      Define this macro to allow references to unknown structure, union,
  678.      or enumeration tags to be emitted.  Standard COFF does not allow
  679.      handling of unknown references, MIPS ECOFF has support for it.
  680.  
  681. `SDB_ALLOW_FORWARD_REFERENCES'
  682.      Define this macro to allow references to structure, union, or
  683.      enumeration tags that have not yet been seen to be handled.  Some
  684.      assemblers choke if forward tags are used, while some require it.
  685.  
  686. File: gcc.info,  Node: Cross-compilation,  Next: Misc,  Prev: Debugging Info,  Up: Target Macros
  687.  
  688. Cross Compilation and Floating Point
  689. ====================================
  690.  
  691.    While all modern machines use 2's complement representation for
  692. integers, there are a variety of representations for floating point
  693. numbers.  This means that in a cross-compiler the representation of
  694. floating point numbers in the compiled program may be different from
  695. that used in the machine doing the compilation.
  696.  
  697.    Because different representation systems may offer different amounts
  698. of range and precision, the cross compiler cannot safely use the host
  699. machine's floating point arithmetic.  Therefore, floating point
  700. constants must be represented in the target machine's format.  This
  701. means that the cross compiler cannot use `atof' to parse a floating
  702. point constant; it must have its own special routine to use instead.
  703. Also, constant folding must emulate the target machine's arithmetic (or
  704. must not be done at all).
  705.  
  706.    The macros in the following table should be defined only if you are
  707. cross compiling between different floating point formats.
  708.  
  709.    Otherwise, don't define them.  Then default definitions will be set
  710. up which use `double' as the data type, `==' to test for equality, etc.
  711.  
  712.    You don't need to worry about how many times you use an operand of
  713. any of these macros.  The compiler never uses operands which have side
  714. effects.
  715.  
  716. `REAL_VALUE_TYPE'
  717.      A macro for the C data type to be used to hold a floating point
  718.      value in the target machine's format.  Typically this would be a
  719.      `struct' containing an array of `int'.
  720.  
  721. `REAL_VALUES_EQUAL (X, Y)'
  722.      A macro for a C expression which compares for equality the two
  723.      values, X and Y, both of type `REAL_VALUE_TYPE'.
  724.  
  725. `REAL_VALUES_LESS (X, Y)'
  726.      A macro for a C expression which tests whether X is less than Y,
  727.      both values being of type `REAL_VALUE_TYPE' and interpreted as
  728.      floating point numbers in the target machine's representation.
  729.  
  730. `REAL_VALUE_LDEXP (X, SCALE)'
  731.      A macro for a C expression which performs the standard library
  732.      function `ldexp', but using the target machine's floating point
  733.      representation.  Both X and the value of the expression have type
  734.      `REAL_VALUE_TYPE'.  The second argument, SCALE, is an integer.
  735.  
  736. `REAL_VALUE_FIX (X)'
  737.      A macro whose definition is a C expression to convert the
  738.      target-machine floating point value X to a signed integer.  X has
  739.      type `REAL_VALUE_TYPE'.
  740.  
  741. `REAL_VALUE_UNSIGNED_FIX (X)'
  742.      A macro whose definition is a C expression to convert the
  743.      target-machine floating point value X to an unsigned integer.  X
  744.      has type `REAL_VALUE_TYPE'.
  745.  
  746. `REAL_VALUE_RNDZINT (X)'
  747.      A macro whose definition is a C expression to round the
  748.      target-machine floating point value X towards zero to an integer
  749.      value (but still as a floating point number).  X has type
  750.      `REAL_VALUE_TYPE', and so does the value.
  751.  
  752. `REAL_VALUE_UNSIGNED_RNDZINT (X)'
  753.      A macro whose definition is a C expression to round the
  754.      target-machine floating point value X towards zero to an unsigned
  755.      integer value (but still represented as a floating point number).
  756.      x has type `REAL_VALUE_TYPE', and so does the value.
  757.  
  758. `REAL_VALUE_ATOF (STRING, MODE)'
  759.      A macro for a C expression which converts STRING, an expression of
  760.      type `char *', into a floating point number in the target machine's
  761.      representation for mode MODE.  The value has type
  762.      `REAL_VALUE_TYPE'.
  763.  
  764. `REAL_INFINITY'
  765.      Define this macro if infinity is a possible floating point value,
  766.      and therefore division by 0 is legitimate.
  767.  
  768. `REAL_VALUE_ISINF (X)'
  769.      A macro for a C expression which determines whether X, a floating
  770.      point value, is infinity.  The value has type `int'.  By default,
  771.      this is defined to call `isinf'.
  772.  
  773. `REAL_VALUE_ISNAN (X)'
  774.      A macro for a C expression which determines whether X, a floating
  775.      point value, is a "nan" (not-a-number).  The value has type `int'.
  776.      By default, this is defined to call `isnan'.
  777.  
  778.    Define the following additional macros if you want to make floating
  779. point constant folding work while cross compiling.  If you don't define
  780. them, cross compilation is still possible, but constant folding will
  781. not happen for floating point values.
  782.  
  783. `REAL_ARITHMETIC (OUTPUT, CODE, X, Y)'
  784.      A macro for a C statement which calculates an arithmetic operation
  785.      of the two floating point values X and Y, both of type
  786.      `REAL_VALUE_TYPE' in the target machine's representation, to
  787.      produce a result of the same type and representation which is
  788.      stored in OUTPUT (which will be a variable).
  789.  
  790.      The operation to be performed is specified by CODE, a tree code
  791.      which will always be one of the following: `PLUS_EXPR',
  792.      `MINUS_EXPR', `MULT_EXPR', `RDIV_EXPR', `MAX_EXPR', `MIN_EXPR'.
  793.  
  794.      The expansion of this macro is responsible for checking for
  795.      overflow.  If overflow happens, the macro expansion should execute
  796.      the statement `return 0;', which indicates the inability to
  797.      perform the arithmetic operation requested.
  798.  
  799. `REAL_VALUE_NEGATE (X)'
  800.      A macro for a C expression which returns the negative of the
  801.      floating point value X.  Both X and the value of the expression
  802.      have type `REAL_VALUE_TYPE' and are in the target machine's
  803.      floating point representation.
  804.  
  805.      There is no way for this macro to report overflow, since overflow
  806.      can't happen in the negation operation.
  807.  
  808. `REAL_VALUE_TRUNCATE (MODE, X)'
  809.      A macro for a C expression which converts the floating point value
  810.      X to mode MODE.
  811.  
  812.      Both X and the value of the expression are in the target machine's
  813.      floating point representation and have type `REAL_VALUE_TYPE'.
  814.      However, the value should have an appropriate bit pattern to be
  815.      output properly as a floating constant whose precision accords
  816.      with mode MODE.
  817.  
  818.      There is no way for this macro to report overflow.
  819.  
  820. `REAL_VALUE_TO_INT (LOW, HIGH, X)'
  821.      A macro for a C expression which converts a floating point value X
  822.      into a double-precision integer which is then stored into LOW and
  823.      HIGH, two variables of type INT.
  824.  
  825. `REAL_VALUE_FROM_INT (X, LOW, HIGH)'
  826.      A macro for a C expression which converts a double-precision
  827.      integer found in LOW and HIGH, two variables of type INT, into a
  828.      floating point value which is then stored into X.
  829.  
  830.